home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dicehelp / DICEHelp_Box.ttx < prev    next >
Text File  |  1995-12-24  |  2KB  |  62 lines

  1. /*
  2. **      $Id: DICEHelp_Box.ttx,v 30.0 1994/06/10 18:05:49 dice Exp $
  3. **
  4. **      DICEHelp help system.  Script for Oxxi TurboText (tm).
  5. **
  6. **      Rexx script modeled after version by David Joiner
  7. */
  8. OPTIONS RESULTS
  9.                                             
  10. 'RequestStr prompt "Enter search string  "'
  11. if (RC > 0) then do
  12.     exit
  13. end
  14. searchline = RESULT
  15.  
  16. hostname = address()            /* Source TTX window */
  17. portname = 'DICEHELP'           /* DICEHelp's port name */
  18. tempname = 't:DICEHelp.temp'    /* Temporary file for passing clips */
  19.  
  20. if ~show('p',portname) then do
  21.     address COMMAND 'RUN >NIL: <NIL: DICEHelp REXXSTARTUP'
  22.  
  23.     do i = 1 to 6
  24.         if ~show('p',portname) then do
  25.             address COMMAND 'wait 1'
  26.         end
  27.     end
  28.  
  29.     if ~show('p',portname) then do
  30.         'SetStatusBar "DICEHelp program not found!"'
  31.             exit
  32.     end
  33. end
  34.  
  35. address value portname
  36. T searchline        /* Search for searchline, return <T>empfile */
  37. if RC=0 then do
  38.     refline   = RESULT
  39.         refstring = SUBWORD( refline, 2 )
  40.  
  41.     address value hostname           /* Back to TTX */
  42.         if WORD( refline, 1 ) = "E" then do
  43.                 'SetStatusBar' refstring
  44.                 exit
  45.     end
  46.  
  47.         OPENDOC NAME refstring
  48.     newport = RESULT        /* get the new editor's port name */
  49.     if RC > 0 then do        /* if not there, then error       */
  50.             'SetStatusBar' "Error opening" refstring
  51.         exit
  52.     end
  53.         address value newport           /* Address the new window */
  54.         SETREADONLY
  55.  
  56.     exit
  57. end
  58. else do
  59.     address value hostname
  60.     'SetStatusBar' "Error code" RC "DICEHelp failed!"
  61. end
  62.